<?php require_once($_SERVER['DOCUMENT_ROOT']."/defaultconf.mex");
require_once($_SERVER['DOCUMENT_ROOT']."/Modules/MF93FL27/modconf.mex");
	MYTCONN(); 
	form_pr('Ben_Properties','','','post');
	mn_field('hidden','ED','Motivo','','','','','');

	$Invoice = 1;
	$Bn_1 = 0;
	$Bn_2 = 0;
	$Bn_Expire = $sysTime;
	$Qur = $GLOBALS['MYT']->db_array("SELECT * FROM bonusinvoice
			INNER JOIN bonusencomendas ON becInvoice = REF
		WHERE becID = {$_GET['RSID']}");
	mn_field('hidden','ED','REF',$Qur[1]['REF'],'5','5','','');

	if ($Qur[1]['bns_Type']  == 4) {
		$ID = '10';
	} 
	if ($Qur[1]['bns_Type']  == 5) {
		$ID = '10';
	} 
	if ($Qur[1]['bns_Type']  == 6) {
		$ID = '09';
		if ($Qur[1]['bns_Status'] == 5 || $Qur[1]['bns_Status'] == 10) {
		$ID = '17';
		
		}
	} 
	if ($Qur[1]['bns_Type']  == 12) {
		$ID = '13';
		
	} 
	$Obj = $Qur[1]['REF'];
	mn_field('button','ED','Reprint','Reimprimir','','','','" 
	onclick="newprint(\''.$GLOBALS['URL'].'Aplications/Export_Print.mex?OB='.$Obj.'&MOD='.$MOD.'&ID='.$ID.'\',\'Printer\');'); 
	 ?>
</form>
<table width="100%"  border="0" cellspacing="3" cellpadding="1">
  <tr>
    <td width="12%" height="20">Movimento: </td>
    <td width="48%" height="20"><?php echo $Qur[1]['REF']; ?></td>
    <td width="40%" height="20">Estado: <?php
	if ($Qur[1]['bns_Status'] == 5 || $Qur[1]['bns_Status'] == 10) {
	echo $Qur[1]['bns_Status'];
	} else {
	echo '<div id="Ben_Properties">';
	$Qu = "SELECT stt_Word AS NAME, sttFlag AS ID FROM hd_sysstatus WHERE stt_Sistema = 25";
	mn_field('select','ED','bns_Status',$Qur[1]['bns_Status'],$Qu,'','','" onChange="
		var StatusWindow = new Ext.Window({
		title:\'Anular Remessa\',
		autoLoad: \'Modules/MF93FL27/lib/ben_sttchg.mex?idOb='.$Obj.'\',
		id: \'statwin\',
		modal:true,
		width:400,
		height:200,
		resizable:false
			});
			StatusWindow.show();');
	} ?></div></td>
  </tr>
  <tr>
    <td height="20">Referencia:</td>
    <td height="20"><?php echo $Qur[1]['INVOICE'];?></td>
    <td height="20">&nbsp;</td>
  </tr>
  <tr>
    <td height="20">Data:</td>
    <td height="20"><?php echo $Qur[1]['bns_Time'];?></td>
    <td height="20">&nbsp;</td>
  </tr>
  <tr>
    <td height="20">Funcionário: </td>
    <td height="20"><?php echo $Qur[1]['bns_User'];?></td>
    <td height="20">&nbsp;</td>
  </tr>
  <tr>
    <td height="20">Cliente:</td>
    <td height="20"><?php echo $Qur[1]['CLIENT'];?></td>
    <td height="20">&nbsp;</td>
  </tr>
  <tr>
    <td height="20">Tipo: </td>
    <td height="20"><?php echo $Qur[1]['bns_Type'];?></td>
    <td height="20">&nbsp;</td>
  </tr>
</table>